/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package azhar.persistance;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Lob;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;

/**
 *
 * @author Al-Insan
 */
@Entity
@Table(name = "sent_item", catalog = "sms_center", schema = "")
@NamedQueries({
    @NamedQuery(name = "SentItem.findAll", query = "SELECT s FROM SentItem s"),
    @NamedQuery(name = "SentItem.findByIdPesan", query = "SELECT s FROM SentItem s WHERE s.idPesan = :idPesan"),
    @NamedQuery(name = "SentItem.findByPenerima", query = "SELECT s FROM SentItem s WHERE s.penerima = :penerima"),
    @NamedQuery(name = "SentItem.findByPesan", query = "SELECT s FROM SentItem s WHERE s.pesan = :pesan"),
    @NamedQuery(name = "SentItem.findByStatus", query = "SELECT s FROM SentItem s WHERE s.status = :status"),
    @NamedQuery(name = "SentItem.findByWaktu", query = "SELECT s FROM SentItem s WHERE s.waktu = :waktu")})
public class SentItem implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "id_pesan")
    private Integer idPesan;
    @Basic(optional = false)
    @Column(name = "penerima")
    private String penerima;
    @Lob
    @Basic(optional = false)
    @Column(name = "pesan", length = 2147483647)
    private String pesan;
    @Basic(optional = false)
    @Column(name = "status")
    private String status;
    @Basic(optional = false)
    @Column(name = "waktu")
    private String waktu;

    public SentItem() {
    }

    public SentItem(Integer idPesan) {
        this.idPesan = idPesan;
    }

    public SentItem(Integer idPesan, String penerima, String pesan, String status, String waktu) {
        this.idPesan = idPesan;
        this.penerima = penerima;
        this.pesan = pesan;
        this.status = status;
        this.waktu = waktu;
    }

    public Integer getIdPesan() {
        return idPesan;
    }

    public void setIdPesan(Integer idPesan) {
        this.idPesan = idPesan;
    }

    public String getPenerima() {
        return penerima;
    }

    public void setPenerima(String penerima) {
        this.penerima = penerima;
    }

    public String getPesan() {
        return pesan;
    }

    public void setPesan(String pesan) {
        this.pesan = pesan;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public String getWaktu() {
        return waktu;
    }

    public void setWaktu(String waktu) {
        this.waktu = waktu;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idPesan != null ? idPesan.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof SentItem)) {
            return false;
        }
        SentItem other = (SentItem) object;
        if ((this.idPesan == null && other.idPesan != null) || (this.idPesan != null && !this.idPesan.equals(other.idPesan))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "azhar.persistance.SentItem[idPesan=" + idPesan + "]";
    }

}
